package cn.com.surker.weight.service;

import cn.com.surker.base.system.vo.SysStorageVo;
import cn.com.surker.weight.dto.WeightStorageInfoDto;
import cn.com.surker.weight.entity.WeightStorageInfo;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import cn.com.surker.spring.RestResultDto;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.List;
import java.util.Map;

/**
* <p>
    * 过磅仓位状态 服务类
    * </p>
*
* @author admin
* @since 2025-05-12
*/
public interface WeightStorageInfoService extends IService<WeightStorageInfo> {

    /**
     * 分页查询仓位信息
     * @param dto
     * @param offset
     * @param limit
     * @return
     */
    IPage findByPage(WeightStorageInfoDto dto, Integer offset, Integer limit);

    /**
     * 更新仓位信息
     * @param dto
     * @return
     */
    RestResultDto updateStatus(WeightStorageInfoDto dto);

    /**
     * 查询操作的仓位信息
     * @return
     */
    List<WeightStorageInfo> findOperateStorage(Long orgId, Integer operationStatus);

    /**
     * 更新
     * @param orgId
     * @param orgName
     * @param storageMap
     * @return
     */
    RestResultDto updateStorageInfoAll(Long orgId, String orgName, Map<String, List<SysStorageVo>> storageMap);

    /**
     * 扫描二维码
     * @param storageInfoDto
     * @return
     */
    RestResultDto scanOpenDoor(WeightStorageInfoDto storageInfoDto);

    /**
     * 关闭阀门
     * @param storageInfoDto
     * @return
     */
    RestResultDto operationDoor(WeightStorageInfoDto storageInfoDto);

    /**
     * 驾驶员关闭阀门
     * @param storageInfoDto
     * @return
     */
    RestResultDto driverOperationDoor(WeightStorageInfoDto storageInfoDto);

    /**
     * 查询抄送未归位仓位
     * @param orgId
     * @return
     */
    List<WeightStorageInfo> findTimeOut(Long orgId);

}
